home *** CD-ROM | disk | FTP | other *** search
/ Floppyshop 2 / Floppyshop - 2.zip / Floppyshop - 2.iso / art&graf.ix / art-0039 / source / dcprtcnv.def < prev    next >
Text File  |  1997-04-16  |  6KB  |  103 lines

  1. DEFINITION MODULE  DCPrtCnv;
  2.  
  3. (*----------------------------------------------------------------------*)
  4. (*                                                                      *)
  5. (*  Version 1.00                July    1988            L.G. Miller     *)
  6. (*                                                                      *)
  7. (*  This is a library module for Degas Convert & Print initially, but   *)
  8. (* can be made more general purpose later.                              *)
  9. (*                                                                      *)
  10. (* What it does:                                                        *)
  11. (*   It returns 'slices' of a monochrome bit image as characters in     *)
  12. (* a form suitable for throwing at a printer.                           *)
  13. (*                                                                      *)
  14. (*  If required:-                                                       *)
  15. (*     It will scale the output picture.                                *)
  16. (*                                                                      *)
  17. (*     It will use a rectangular portion of the input picture.          *)
  18. (*                                                                      *)
  19. (*     It will rotate the image by a 90 degrees.                        *)
  20. (*                                                                      *)
  21. (*  Limitations.                                                        *)
  22. (*                                                                      *)
  23. (*   As its designed for working with printers, the output is aimed     *)
  24. (*  at 8 & 24 pin printers.                                             *)
  25. (*                                                                      *)
  26. (*   As fixed point calculations are used, the scaling will be limited  *)
  27. (*  in range.                                                           *)
  28. (*                                                                      *)
  29. (*   The scaling factor will be decided by the input & output sizes     *)
  30. (*  requested which will be in 'dots'. Be aware that fixed precision    *)
  31. (*  calculations are used and results will be strange if extremes of    *)
  32. (*  scaling are required. Try and keep the range within 1/4 .. 4 times. *)
  33. (*                                                                      *)
  34. (*   The output will be in whole character intervals i.e. multiples     *)
  35. (*  of 8 bits. This version will only use 8 or 24 bits. The 24 bit      *)
  36. (*  output will be <top> <middle> <bottom> order for each column to     *)
  37. (*  be printed.                                                         *)
  38. (*                                                                      *)
  39. (*   These routines will be less than quick!                            *)
  40. (*                                                                      *)
  41. (*  How to use the routines                                             *)
  42. (*  -----------------------                                             *)
  43. (*                                                                      *)
  44. (*   1) The first call will initialise the conversion routine with      *)
  45. (*      the picture, scaling etc and returns the first slice.           *)
  46. (*                                                                      *)
  47. (*   2) subsequent calls will return a 'slice' until the end of         *)
  48. (*      the picture.                                                    *)
  49. (*                                                                      *)
  50. (*   The conversion can be restarted or changed on any call.            *)
  51. (*                                                                      *)
  52. (*   These routines can ONLY work on ONE picture at a time as it        *)
  53. (*  'remembers' the previous values of the variables.                   *)
  54. (*                                                                      *)
  55. (*                                                                      *)
  56. (*----------------------------------------------------------------------*)
  57.  
  58. FROM DCGlobal           IMPORT HiResScreen,
  59.                                PrinterTypes;
  60.  
  61.  
  62. PROCEDURE SetPrinterToUse( printer : PrinterTypes );
  63.  
  64. PROCEDURE QueryPrinterToUse() : PrinterTypes;
  65.  
  66.  
  67. PROCEDURE PrtCnv8BitSlice ( NewPicture     : BOOLEAN; (* TRUE is restart *)
  68.                             VAR last       : BOOLEAN; (* TRUE if end *)
  69.                             VAR pic        : HiResScreen;
  70.                                 InX, InY,    (* start co-ord in pic   *)
  71.                                 PicWidth,    (* width (width) reqd.   *)
  72.                                 PicHeight,   (* depth (pixel) reqd.   *)
  73.  
  74.                                 PrintWidth,  (* print dot width reqd. *)
  75.                                 PrintHeight  (* print dot depth reqd. *)
  76.                                               : INTEGER;
  77.                                 Landscape  : BOOLEAN; (* TRUE = Landscape*)
  78.                                                       (* x is vertical  *)
  79.                             VAR buffer     : ARRAY OF CHAR (* out *)
  80.                             );
  81.  
  82.  
  83.  
  84. PROCEDURE PrtCnv24BitSlice ( NewPicture     : BOOLEAN; (* TRUE is restart *)
  85.                              VAR last       : BOOLEAN; (* TRUE if end *)
  86.                              VAR pic        : HiResScreen;
  87.                                  InX, InY,    (* start co-ord in pic   *)
  88.                                  PicWidth,    (* width (pixels) reqd.  *)
  89.                                  PicHeight,   (* depth (pixels) reqd.  *)
  90.  
  91.                                  PrintWidth,  (* print width reqd.     *)
  92.                                  PrintHeight  (* print depth reqd.     *)
  93.                                               : INTEGER;
  94.                                  Landscape   : BOOLEAN;(* TRUE = Landscape*)
  95.                                                       (* x is vertical   *)
  96.                              VAR buffer     : ARRAY OF CHAR (* out *)
  97.                             );
  98.  
  99.  
  100. END DCPrtCnv.
  101.